# $Id: Makefile,v 1.11 1997/10/29 19:36:07 sauderd DP3.1 $

# This code was developed with the support of the United States Government,
# and is not subject to copyright.

MAKE_RULES =  ../../make_rules
include $(MAKE_RULES)

PDES = ../../..


###############################################################

#  This Makefile builds the SCL editor and stepcore library.  The
#  library can be made as a whole or in two parts: the editor and the
#  stepcore.  All files below this point are made using relative paths
#  based on the PDES and LIBRARY macro.  The make_rules file specifies
#  which compiler and preprocessors will be used.

LIBRARY = ../../lib/libCdai.a

###############################################################

SDAI		= $(PDES)/src/cldai
CORE		= $(PDES)/src/clstepcore
SCL_EDITOR	= $(PDES)/src/cleditor
UTILS		= $(PDES)/src/clutils

PDESINCLUDES =	-I$(SDAI)	\
		-I$(CORE) \
		-I$(UTILS)

#		-I$(SCL_EDITOR) \

INCLUDES =	-I../.. $(MR_INCLUDES) \
		$(PDESINCLUDES) 

#OPARAMETER_DATA = \
#	EntityInstance.o
# currently there is only an EntityInstance.h file

OSESSION = \
	sdaiSession_instance.o

#OSESSION = \
#	Event.inline.o  \
#	ErrorEvent.inline.o  \
#	Implementation.inline.o  \
#	SessionEvents.inline.o  \
#	Transaction.inline.o \
#	Repository.inline.o  \
#	Session.o

OPOPULATION = \
	sdaiObject.o \
	sdaiDaObject.o \
	sdaiEntity_extent.o \
	sdaiEntity_extent_set.o \
	sdaiModel_contents.o \
	sdaiModel_contents_list.o

#	SchemaInstance.inline.o
#	Model.inline.o \

OOTHER = \
	sdaiApplication_instance_set.o

#	EntityExtentSet.o
#	EntityInstanceSet.o

#session - sdai_session, implementation, sdai_repository, 
#	   sdai_repository_contents, sdai_transaction, event, error_event

#population - schema_instance, sdai_model, sdai_model_contents, entity_extent,
#	      scope

#parameter data - entity_instance, application_instance, sdai_instance,
#		  dictionary_instance, session_instance

OFILES = $(OOTHER) $(OPARAMETER_DATA) $(OSESSION) $(OPOPULATION)


%.o:  $(SDAI)/%.cc  
	@echo " "
	@echo "compiling $<";
	$(CXX) $(CFLAGS) $(INCLUDES)  -c $<;

#	$(CC) $(CFLAGS) -DSDAI_CPP_LATE_BINDING $(INCLUDES)  -c $<;

#			make the whole library
all: lib

lib: $(LIBRARY)

#			make the whole library
$(LIBRARY): $(OFILES)
	@echo " "
	@echo "making $(LIBRARY)"
	echo "ar rc $(LIBRARY) $?"; \
	ar rc $(LIBRARY) $?; \
	echo "$(RANLIB) $(LIBRARY)"; \
	$(RANLIB) $(LIBRARY); \

test:	lib stub $(TEST_DIR)/scltest.o
	cd $(TEST_DIR); $(MAKE) all

clean:
	rm $(OFILES) $(LIBRARY)
 
build:	checkout all

checkout:
	cd $(SDAI); co checkout; checkout;

depend:
	$(MAKE_DEPEND) $(MR_COND_DEFS) $(CPLUSINCLUDES) $(INCLUDES) $(SDAI)/*.cc

#
# dependencies generated by makedepend
#

# DO NOT DELETE THIS LINE -- make depend depends on it.
